﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProgNetDxComponents.ExtenderProviders.Browsers;

namespace ProgNetDxComponents.Design.Editors
{
    public class BrowserColumnEditor : ProgNetComponents.Design.Editors.BaseListEditor
    {
        Dictionary<string, object> list = new Dictionary<string, object>();
        protected override Dictionary<string, object> GetListBoxItems()
        {
            list.Clear();
            if (this._Context != null && _Context.Instance != null && _Context.Instance is Browser)
            {
                Browser b = _Context.Instance as Browser;
                foreach (BrowserColumn col in b.Columns)
                    if (col.Name.IsNotNull() && !list.ContainsKey(col.Name))
                        list.Add(col.Name, col.Name);
            }
            return list;
        }
    }
}
